package com.lsj.spring.service.impl;

import com.lsj.spring.mapper.TUserMapper;
import com.lsj.spring.model.TUser;
import com.lsj.spring.service.TUserService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Lsj
 * @version 1.0
 * @date 2021/6/26 16:14
 */
@Service
@AllArgsConstructor
public class TUserServiceImpl implements TUserService {

    private TUserMapper tUserMapper;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteByPrimaryKey(Integer id) {
        return tUserMapper.deleteByPrimaryKey(id);
    }


    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insert(TUser record) {
        return tUserMapper.insert(record);
    }


    @Override
    @Transactional(rollbackFor = Exception.class)
    public TUser selectByPrimaryKey(Integer id) {
        return tUserMapper.selectByPrimaryKey(id);
    }


    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateByPrimaryKey(TUser record) {
        return tUserMapper.updateByPrimaryKey(record);
    }
}
